#include "AmericanProduct.h"
#include <algorithm>

double AmericanProduct::getExpiry() const
{
	return m_expiry;
}

AmericanProduct::AmericanProduct(const PayOffBridge& payoff,double expiry)
	:m_expiry(expiry),m_payoff(payoff)
{
}
double AmericanProduct::calcFinalPayOff(double spot) const
{
	return m_payoff(spot);
}
double AmericanProduct::calcMidPayOff(double spot, double time,double discountedPayOff) const
{
	return std::max(m_payoff(spot),discountedPayOff);
}
AmericanProduct* AmericanProduct::clone() const
{
	return new AmericanProduct(*this);
}